<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理 - 易买网</title>
<link type="text/css" rel="stylesheet" href="../css/style.css" />
<script type="text/javascript" src="../scripts/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../scripts/function.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/laypage/laypage.js"></script>
<script type="text/javascript">
       var search=function(pageCode){
    		
    		var empno=$("#empno").val();
    	       var entityId = $("entityId").val();
    	       var userName = $("userName").val();
    	       var url = "OrderServlet";
    	       var data = {'pageCode':pageCode,'entityId':entityId,'userName':userName,'op':'allOrder'};
    		$.post(url,data,function(result){
    			$("#data").html('');
    			$.each(result.beanList,function(idx,Orderdetail){
    				$("#data").append("<tr><th>单号:"+Orderdetail.ouid+"</th><th>时间:"+Orderdetail.oorder_date+"</th><th>状态:"+Orderdetail.ostatus+"</th><tr>");
    				$("#data").append("<tr><td>"+Orderdetail.od_gimg_url+"</td><td>"+Orderdetail.odgprice+"</td><td>"+Orderdetail.odgnum+"</td><td>"+Orderdetail.totalCount+"</td></tr>");
    				$("#data").append("<tr><td>"+Orderdetail.odgname+"</td></tr>");
    			})
    			
    			//分页
    			  laypage({
    					cont : 'pager',  //容器id：存放分页
    					pages : result.totalPage, //得到总页数
    					curr:  result.pageCode || 1,  //当前页
    					skip: true, //是否开启跳页
    					skin: '#AF0000',  //页码的颜色
    					groups: 10,  //
    					jump : function(obj, first) {
    						if (!first) {   //首次加载不执行，并传递当前页：obj.curr
    							search(obj.curr);  //调用函数
    						}
    					}
    				}); 
    			
    		},"json")
    	}

    	search(1);

    	$(document).ready(function(){
    			$("#searchOrder").click(function(){
    				search(1);	
    			})
    	})

</script>
</head>
<body>
<jsp:include page="menu.jsp" />
	<div class="main">
		<h2>订单管理</h2>
		<div class="manage">
			<div class="search">				
			</div>
			<div class="spacer"></div>
            <form id="orderForm" method="post"  action="Order">
                 订单号：<input type="text" class="text" name="entityId" id="entityId" />
                 订货人：<input type="text" class="text" name="userName" id="userName" />
                 <label class="ui-blue"><input type="submit" name="submit" value="查询" id="searchOrder" /></label>
            </form>
			<table class="list" id="data">
				 <tr>
					<th colspan="2">单号：1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 时间：2013-3-16</th>					
					<th colspan="2">状态:收货确认</th>					
				</tr>
				<tr>
					<td class="first w4 c"><img src="../images/product/1.jpg" />画册</td>
					<td >100</td>
					<td>1</td>
					<td class="w1 c" rowspan="2">总计：140</td>					
				</tr>
				<tr>
					<td class="first w4 c"><img src="../images/product/2.jpg" />项链</td>
					<td >40</td>
					<td>1</td>			
				</tr>
                	<tr>
					<th colspan="2">单号：2 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;时间：2013-5-16</th>
					<th colspan="2">状态:待审核<select name="status" >						    
								<option value="1"  >待审核</option>
								<option value="2"  >审核通过</option>
								<option value="3"  >配货</option>
								<option value="4" >发货</option>
								<option value="5"  >收货确认</option>
							
						</select></th>					
				</tr>
				<tr>
					<td class="first w4 c"><img src="../images/product/3.jpg" />护肤王</td>
					<td >400</td>
					<td>1</td>
					<td class="w1 c">总计：400</td>					
				</tr>				
			</table>
			<div class="pager">
				<!-- <ul class="clearfix">
					<li><a >首页</a></li>
					<li>...</li>
					<li><a >4</a></li>
					<li class="current">5</li>
                    <li><a >6</a></li>
                    <li>...</li>
					<li><a >尾页</a></li>
				</ul> -->
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>
<div id="footer">
	Copyright &copy; 2013 云和学院 All Rights Reserved. 京ICP证1000001号</div>
</body>
</html>
